<%--
  Created by IntelliJ IDEA.
  User: oldliu
  Date: 2023-06-05
  Time: 14:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-3.6.3.min.js.txt"></script>
    <script>
        $(function () {
           $("form").submit(function () {
                if($(":checkbox[name=guanxin]:checked").length>=2)
                {
                    return true;
                }
                alert("关心的技术至少选择两个");
                return false;
           });
        });
    </script>
</head>
<body>
    <h3>云豆网注册</h3>
<form action="doReg.jsp" method="get" >
    <p>
        <label>用户名</label><input type="text" name="uname" required/>
    </p>
    <p>
        <label>手机号</label><input type="text" name="phone" required/>
    </p>
    <p>
        <label>年龄</label><input type="number" min="10" name="age" value="14" />
    </p>
    <p>
        <label>关心哪些技术（至少选两个）:</label>
        <input type="checkbox" name="guanxin" value="dancing"/>跳舞
        <input type="checkbox"  name="guanxin" value="sing"/>唱歌
        <input type="checkbox"  name="guanxin" value="java"/>Java
        <input type="checkbox"  name="guanxin" value="python"/>python
        <input type="checkbox"  name="guanxin" value="c#"/>C#
        <input type="checkbox"  name="guanxin" value="design"/>设计
    </p>
    <p>
        <input type="submit" />
    </p>
</form>
</body>
</html>
